package it.cast.wechat.dto;

/**
 * 封装json对象，所有返回结果都使用它
 */
public class Result<T> {

	private T data;// 成功时返回的数据

	private String errorMsg;// 错误信息

	private int code;

	public Result() {
	}

	// 成功时的构造器
	public Result(T data) {
		this.data = data;
	}

	// 错误时的构造器
	public Result(int code, String errorMsg) {
		this.errorMsg = errorMsg;
		this.code = code;
	}


	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}
